﻿<go:ControlBase x:Class="SuperGo.Silverlight.GameStatus"
    xmlns="http://schemas.microsoft.com/client/2007" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:go="clr-namespace:SuperGo.Silverlight"
    >
    
    <Grid x:Name="LayoutRoot" VerticalAlignment="Top" HorizontalAlignment="Left">
        <Grid.Resources>
            <Style TargetType="TextBlock" x:Key="TitleText">
                <Setter Property="FontFamily" Value="Arial" />
                <Setter Property="FontWeight" Value="Bold" />
            </Style>
            <Style TargetType="TextBlock" x:Key="ContentText">
                <Setter Property="FontFamily" Value="Arial" />
                <Setter Property="HorizontalAlignment" Value="Right" />
            </Style>
            <Style TargetType="Button" x:Key="ButtonContent">
                <Setter Property="FontFamily" Value="Arial" />
                <Setter Property="Height" Value="25" />
                <Setter Property="Background" Value="#006633" />
            </Style>
        </Grid.Resources>

        <Grid x:Name="_hiddenFields" Width="1" Height="1" HorizontalAlignment="Center" VerticalAlignment="Top" />
            
        <StackPanel>
            <go:GoPanel x:Name="_superGo" Title="Super Go">
                <StackPanel Orientation="Vertical">
                    <Button x:Name="_newGame" Content="New Game" Margin="0,0,0,10" />
                    <Button x:Name="_activeGames" Content="Active Games" Margin="0,0,0,10" />
                    <Button x:Name="_preferences" Content="Preferences" />
                </StackPanel>
            </go:GoPanel>
            <go:GoPanel x:Name="_gameStatus" Title="Game Status" Grid.Row="0" Grid.ColumnSpan="2" Margin="0,10,0,0">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition Width="25" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                        <RowDefinition />
                    </Grid.RowDefinitions>

                    <TextBlock Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource TitleText}">Status: </TextBlock>
                    <TextBlock Grid.Row="0" Grid.ColumnSpan="2" Style="{StaticResource ContentText}" Text="{Binding Status}"></TextBlock>

                    <TextBlock Grid.Column="0" Grid.Row="1" Style="{StaticResource TitleText}">Move: </TextBlock>
                    <TextBlock Grid.Column="1" Grid.Row="1" Style="{StaticResource ContentText}" Text="{Binding TurnToDisplay}"></TextBlock>

                    <TextBlock Grid.Column="0" Grid.Row="2" Style="{StaticResource TitleText}">Black Captures: </TextBlock>
                    <TextBlock Grid.Column="1" Grid.Row="2" Style="{StaticResource ContentText}" Text="{Binding BlackCaptures}"></TextBlock>

                    <TextBlock Grid.Column="0" Grid.Row="3" Style="{StaticResource TitleText}">White Captures: </TextBlock>
                    <TextBlock Grid.Column="1" Grid.Row="3" Style="{StaticResource ContentText}" Text="{Binding WhiteCaptures}"></TextBlock>
                </Grid>
            </go:GoPanel>

            <go:GoPanel x:Name="_historyButtons" Title="History" Grid.Row="1" Grid.ColumnSpan="2" Margin="0, 10, 0, 0">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <Button Grid.Column="0" x:Name="_historyFirst" Margin="0,0,5,0" IsEnabled="{Binding IsHistoryFirstEnabled}" Content="First" Style="{StaticResource ButtonContent}" />
                    <Button Grid.Column="1" x:Name="_historyPrevious" Margin="0,0,5,0" IsEnabled="{Binding IsHistoryPreviousEnabled}" Content="Previous" Style="{StaticResource ButtonContent}" />
                    <Button Grid.Column="2" x:Name="_historyNext" Margin="0,0,5,0" Content="Next" IsEnabled="{Binding IsHistoryNextEnabled}" Style="{StaticResource ButtonContent}" />
                    <Button Grid.Column="3" x:Name="_historyLast" Content="Last" IsEnabled="{Binding IsHistoryLastEnabled}" Style="{StaticResource ButtonContent}" />
                </Grid>
            </go:GoPanel>

            <go:GoPanel x:Name="_playOptions" Grid.Row="2" Title="Play Options" Grid.ColumnSpan="2" Margin="0, 10, 0, 0">
                <StackPanel x:Name="_playOptionsStackPanel">
                    <Button x:Name="_pass" Margin="0,0,0,10" Content="Pass" IsEnabled="{Binding LoggedInUserToMove}"  Style="{StaticResource ButtonContent}" />
                    <Button x:Name="_doneMarkingDeadGroups" Margin="0,0,0,10" Content="Done Marking Dead Groups" Height="50" Style="{StaticResource ButtonContent}" Visibility="Collapsed" />
                    <Button x:Name="_resign" Content="Resign" Style="{StaticResource ButtonContent}" />
                </StackPanel>
            </go:GoPanel>
        </StackPanel>
    </Grid>
</go:ControlBase>
